<?php
$file = '/tmp/'.$_GET['f'].'.prolist';
$keyword = '/'.preg_quote($_GET['k']).'/i';

if(!file_exists($file)) exit();

$data = unserialize(file_get_contents($file));
$search_data = preg_grep($keyword, $data);
unset($data);
if(is_array($search_data)) {
	print "<?xml version=\"1.0\" encoding=\"utf-8\" ?><root>";
	foreach ($search_data as $md5 => $name) {
		print "<program md5=\"$md5\" name=\"".iconv('gb2312', 'utf-8', $name)."\" />";
	}
	print "</root>";
}
?>